public class VirtualMachine {
	private String name;
	private int memory;
	private int vcpu;
	private int disk;
	private int lan;
	private double price;
	private long endTime = 0;
	private int id;

	public String getname() {
		return name;
	}
	
	public void setname(String vmName) {
		this.name = vmName;
	}
	
	public int getmemory() {
		return memory;
	}

	public void setmemory(int memory) {
		this.memory = memory;
	}

	public int getvcpu() {
		return vcpu;
	}

	public void setvcpu(int vcpu) {
		this.vcpu = vcpu;
	}

	public int getdisk() {
		return disk;
	}

	public void setdisk(int disk) {
		this.disk = disk;
	}

	public int getlan() {
		return lan;
	}

	public void setlan(int lan) {
		this.lan = lan;
	}

	public void setprice(double price) {
		this.price = price;
	}
  
	public double getprice() {
		return price;
	}
  
	// Returns time remaining before task completes (ms)
	public long getTime() {
		long temp = System.currentTimeMillis();
		
		if (endTime > temp) {
			return (endTime - temp);
		} else {
			return 0;
		}
	}
	
	// Starts new task provided VM is idle (input in ms)
	// Returns 0 if no conflict, otherwise 1 to indicate previous job not done
	public int setTime(int jobTime) {
		long temp = System.currentTimeMillis();
		
		if (endTime < temp) {
			endTime = temp + jobTime;
			return 0;
		} else {
			return 1;
		}
	}
	
	public int getid() {
		return id;
	}
	
	public void setid(int vmID) {
		this.id = vmID;
	}
	
} 